<?PHP
	
	function xmlSelect($query, $link) {
		$Filas = $link -> selectXML($query);
		if ($Filas) {
			header("Content-type: text/xml");
			echo '<?xml version="1.0" encoding="UTF-8"?>';
			echo "\n<consulta>\n";
			foreach ($Filas as $Fila) {
				echo "	<fila>\n";
				$Col = 0;
				while (isset($Fila[$Col])) {
					echo "		$Fila[$Col]\n";
					$Col++;
				}
				echo "	</fila>\n";
			}
			echo "</consulta>";
		}
		else
			echo "2";
	}

	function operacion($query, $link) {
		header("Content-type: text/plain");
		if ($link -> operacion($query))
			echo "1";
		else
			echo "2";
	}

	function select($query, $link) {
		header("Content-type: text/plain");
		if (@$link -> select($query))
			echo "1";
		else
			echo "2";
	}
?>